 <template>
    <div>
        <el-table
            :data="studyGrades"
            style="width: 100%">
            <el-table-column
                prop="p1"
                label="文章名"
                width="180">
            </el-table-column>
            <el-table-column
                prop="p2"
                label="作者"
                width="180">
            </el-table-column>
            <el-table-column
                prop="p4"
                label="得分">
            </el-table-column>
            <el-table-column
                prop="p5"
                label="操作">
                <template slot-scope="scope">
                    <el-button @click="getHomework(scope.row.p5)">查看题目</el-button>
                </template>
            </el-table-column>
        </el-table>
    </div>
  </template>

  <script>
      import {mapActions, mapGetters} from 'vuex';
    export default {
      computed:{
          ...mapGetters(['studyGrades'])
      },
      methods:{
          getHomework(eid){
              console.log(eid)
              this.updateHomeWork(eid)
              this.$router.push({
                  path:`/lookhomework/${eid}`
              })
          },
          ...mapActions(['updateHomeWork'])
      }
    }
  </script>